/**
 * 
 */
package edu.fjut.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import edu.fjut.domain.Storage;
import edu.fjut.jdbc.JDbc;


/**
 * @author jiayu
 *
 */
public class StorageDaoJDBCImpl implements StorageDao {
	private static final String ADD_STU = "insert into tbl_storage values(?,?)"; 
	/* (non-Javadoc)
	 * @see edu.fjut.dao.StorageDao#regStu(edu.fjut.domain.Storage)
	 */
	@Override
	public void regStu(Storage stu) {
		
		Connection conn = JDbc.getConn();
		PreparedStatement pstmt = null;
		
		try {
			
			pstmt = conn.prepareStatement(ADD_STU);
			pstmt.setString(1, stu.getStoName());
			pstmt.setString(2, stu.getStoPass());
			pstmt.executeUpdate(); 		
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			JDbc.releaseRes(conn, pstmt, null);
		}
		
	   			
	}
    
}


